//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.mega.ycy.network;

import com.mega.ycy.common.event.SlashUpdateEvent;
import io.netty.buffer.ByteBuf;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

public class TimestopMessage implements IMessage {
    boolean stop;

    public TimestopMessage() {
    }

    public TimestopMessage(Boolean stop) {
        this.stop = stop;
    }

    public void toBytes(ByteBuf buf) {
        buf.writeBoolean(this.stop);
    }

    public void fromBytes(ByteBuf buf) {
        this.stop = buf.readBoolean();
    }

    public static class MessageHandler implements IMessageHandler<TimestopMessage, IMessage> {
        public MessageHandler() {
        }

        public IMessage onMessage(TimestopMessage m, MessageContext ctx) {
            SlashUpdateEvent.setTimestop(m.stop);
            return null;
        }
    }
}
